package continuity;

/**
 * Zetor csapat szekelton
 * 
 * A program célja hogy a modellről eldönthető legyen, hogy a feladat egy helyes
 * megoldását nyújtja.
 * 
 * @author Balogh Peter Tamas
 * @author Gál István László
 * @author Kárász Gábor
 * @author Simon Endre András
 * @author Szabó Alex
 */
public class Character implements Sprite {

    private Point3d position;
    private boolean hasKey;
    private boolean canMove;
    private Game game;
    private Level level;
    private int moveDir;
    /**
     * 
     */
    static public String className = "Character";
    /**
     * 
     */
    public String name;

    /**
     * 
     * @param pos
     * @param g
     * @param n
     */
    public Character(Point3d pos, Game g, String n) {
        name = n;
    }

    /**
     * 
     */
    public void reset() {
    }

    /**
     * 
     * @param pos
     */
    public void setPosition(Point3d pos) {
    }

    /**
     * 
     */
    public void getHasKey() {
    }

    /**
     * 
     */
    public void setHasKey() {
    }

    /**
     * 
     */
    public void resetHasKey() {
    }

    /**
     * 
     * @param dir
     */
    public void move(int dir) {
        moveDir = dir;
        String classInfo = name + "(" + className + ")::Move(): void";
        Continuity.methodEntry(classInfo);
        LevelItem actualLevelItem = new LevelItem("ActualLevel");
        Continuity.methodCall(className, name, LevelItem.className, actualLevelItem.name, "checkEdges(Point3d, dir):bool");
        actualLevelItem.checkEdges(new Point3d(), dir);
        Continuity.methodExit(classInfo);
        Continuity.methodVoid();
    }

    /**
     * 
     * @param t
     */
    public void setCanMove(Boolean t) {
        String classInfo = name + "(" + className + ")::setCanMove(Bool t): void";
        Continuity.methodEntry(classInfo);
        game = new Game("game");
        if (!t) {
            Continuity.Alt("A karakter lefele esik, es meghal (3.4.8)");
            Continuity.methodCall(className, name, Game.className, game.name, "restartGame(): void");
            game.restartGame();

        }
        Continuity.methodExit(classInfo);
        Continuity.methodVoid();
    }

    /**
     * 
     */
    public void Tick() {
        String classInfo = name + "(" + className + ")::Tick(): void";
        Continuity.methodEntry(classInfo);
        Continuity.methodExit(classInfo);
        Continuity.methodVoid();
    }

    /**
     * 
     */
    @Override
    public void getPosition() {
    }

    /**
     * 
     * @param s
     */
    @Override
    public void checkHit(Sprite s) {
        String classInfo = name + "(" + className + ")::checkHit(Sprite s): void";
        Continuity.methodEntry(classInfo);

        Continuity.methodCall(className, name, s.getType(), (s).getName(), "checkHit(" + ((Character) this).name + ")");
        s.checkHit(this);
        Continuity.methodReturn(LevelItem.className, "ActualItem", className, name, "hit");

        Continuity.methodExit(classInfo);
        Continuity.methodVoid();
    }

    /**
     * 
     */
    @Override
    public void getWidth() {
    }

    /**
     * 
     */
    @Override
    public void getHeight() {
    }

    /**
     * 
     * @return
     */
    public String getType() {
        return className;
    }

    /**
     * 
     * @return
     */
    @Override
    public String getName() {
        return name;
    }

    public void setLevel(Level l) {
        level = l;
    }
}
